package com.foreveross.fetl.core.domain.freight;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.dayatang.domain.InstanceFactory;
import com.foreveross.fetl.common.domain.BaseEntity;
import com.foreveross.fetl.core.domain.freight.repository.IAirChinaDomesticRepository;

@Entity
@Table(name="airChina_domestic")
public class AirChinaDomesticEntity extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 489058574685820836L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	/**
	 * 抓取rowkey
	 */
	@Column(name="HBASE_KEY")
	private String hbaseKey;
	
	/**
	 * 航班所属航空公司简称 CA
	 */
	@Column(name="CARRIER_KEY")
	private String carrierKey;
	
	/**
	 * 报表日期  2014-01-01
	 */
	@Column(name="REPROT_DATE")
	private Date reportDate;
	
	/**
	 * 航班日期 2014-01-01
	 */
	@Column(name="FLIGHT_DATE")
	private Date flightDate;
	
	/**
	 * 创建时间
	 */
	@Column(name="CREAT_TIME")
	private Date creatTime;
	
	/**
	 * 出发城市三字码
	 */
	@Column(name="FROM_CITY")
	private String fromCity;
	
	/**
	 * 出发城市名称
	 */
	@Column(name="FROM_CITY_NAME")
	private String fromCityName;
	
	/**
	 * 到达城市三字码
	 */
	@Column(name="TO_CITY")
	private String toCity;
	
	
	/**
	 * 到达城市名称
	 */
	@Column(name="TO_CITY_NAME")
	private String toCityName;
	
	/**
	 * 航班号
	 */
	@Column(name="FLIGHT_NO")
	private String flightNo;
	
	/**
	 * 头等舱价格
	 */
	@Column(name="PRIME_PRICE")
	private Double primePrice;
	
	
	/**
	 * 公务舱价格
	 */
	@Column(name="BUSINESS_PRICE")
	private Double businessPrice;
	
	
	
	/**
	 * 经济舱价格
	 */
	@Column(name="ECONOMY_PRICE")
	private Double economyPrice;
	
	

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getHbaseKey() {
		return hbaseKey;
	}

	public void setHbaseKey(String hbaseKey) {
		this.hbaseKey = hbaseKey;
	}
	
	

	public String getCarrierKey() {
		return carrierKey;
	}

	public void setCarrierKey(String carrierKey) {
		this.carrierKey = carrierKey;
	}

	public Date getReportDate() {
		return reportDate;
	}

	public void setReportDate(Date reportDate) {
		this.reportDate = reportDate;
	}

	public Date getFlightDate() {
		return flightDate;
	}

	public void setFlightDate(Date flightDate) {
		this.flightDate = flightDate;
	}

	public String getFromCity() {
		return fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCity() {
		return toCity;
	}

	public void setToCity(String toCity) {
		this.toCity = toCity;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}

	public String getFlightNo() {
		return flightNo;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}

	public Double getPrimePrice() {
		return primePrice;
	}

	public void setPrimePrice(Double primePrice) {
		this.primePrice = primePrice;
	}


	public Double getBusinessPrice() {
		return businessPrice;
	}

	public void setBusinessPrice(Double businessPrice) {
		this.businessPrice = businessPrice;
	}

	public Double getEconomyPrice() {
		return economyPrice;
	}

	public void setEconomyPrice(Double economyPrice) {
		this.economyPrice = economyPrice;
	}


	public Date getCreatTime() {
		return creatTime;
	}

	public void setCreatTime(Date creatTime) {
		this.creatTime = creatTime;
	}
	
	public IAirChinaDomesticRepository getIAirChinaDomesticRepository(){
		return InstanceFactory.getInstance(IAirChinaDomesticRepository.class);
	}
	
	public int creatReport(List<String> airCompanys, String formCity,
			String toCity, Date reportDate, Date flightDate) {
		return getIAirChinaDomesticRepository().creatReport(airCompanys,
				formCity, toCity, reportDate, flightDate);
	}
}
